package com.xdf.xzymanagementsystem.util;

import java.io.File;

public class FileUtils {
    public static Boolean isFileExists(String fileName){
        if( fileName == null || fileName.length()<=0 ) return false;
        File file = new File(fileName);
        return file.exists();
    }

    public static Boolean deleteFile(String fileName){
        if( !isFileExists(fileName) ) return false;
        File file = new File(fileName);
        return file.delete();
    }

    // 获取文件后缀名称
    public static String getFileExtension(String fileName){
        if( fileName == null || fileName.length()<=0 ) return "";
        String[] strArray = fileName.split("\\.");
        return strArray[strArray.length-1];
    }


}
